<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    protected function _initConfig() {
        global $config;
        $config = new Zend_Config($this->getOptions());
        Zend_Registry::set('config', $config);
        Zend_Registry::set('ROUTER', $this->getRouterArray());
        return $config;
    }

    public function getRouterControllerArray() {
        //Root Url
        $ROUTER['base']['index'] = '/';

        //Service Url
        $ROUTER['services']['index'] = '/services';

        //Web Development
        $ROUTER['webdevelopment']['index'] = '/webdevelopment';
        $ROUTER['webdevelopment']['phpdevelopment'] = '/webdevelopment/phpdevelopment';
        $ROUTER['webdevelopment']['mobilewebdevelopment'] = '/webdevelopment/mobilewebdevelopment';

        //Web Design
        $ROUTER['webdesign']['index'] = '/webdesign';
        $ROUTER['webdesign']['htmldevelopment'] = '/webdesign/htmldevelopment';
        $ROUTER['webdesign']['logodesign'] = '/webdesign/logodesign';
        $ROUTER['webdesign']['psddevelopment'] = '/webdesign/psddevelopment';
        $ROUTER['webdesign']['psdtohtmldevlopment'] = '/webdesign/psdtohtmldevlopment';
        $ROUTER['webdesign']['jquerydevelopment'] = '/webdesign/jquerydevelopment';

        //Open Source
        $ROUTER['opensource']['index'] = '/opensource/';
        $ROUTER['opensource']['zend'] = '/opensource/zend';
        $ROUTER['opensource']['cakephp'] = '/opensource/cakephp';
        $ROUTER['opensource']['codeigniter'] = '/opensource/codeigniter';
        $ROUTER['opensource']['wordpress'] = '/opensource/wordpress';
        $ROUTER['opensource']['joomla'] = '/opensource/joomla';
        $ROUTER['opensource']['drupal'] = '/opensource/drupal';
        $ROUTER['opensource']['oscommerce'] = '/opensource/oscommerce';
        $ROUTER['opensource']['magento'] = '/opensource/magento';

        //Internet Marketing
        $ROUTER['internetmarketing']['index'] = '/internetmarketing/';
        $ROUTER['internetmarketing']['seoservices'] = '/internetmarketing/seoservices';
        $ROUTER['internetmarketing']['searchenginemarketing'] = '/internetmarketing/searchenginemarketing';
        $ROUTER['internetmarketing']['socialmedia'] = '/internetmarketing/socialmedia';
        $ROUTER['internetmarketing']['mobilemarketing'] = '/internetmarketing/mobilemarketing';

        //Mobile Application
        $ROUTER['mobileapplication']['index'] = '/mobileapplication/';
        $ROUTER['mobileapplication']['iphoneappdevelopment'] = '/mobileapplication/iphoneappdevelopment';
        $ROUTER['mobileapplication']['androidappdevelopment'] = '/mobileapplication/androidappdevelopment';

        //Showcase Url
        $ROUTER['showcase']['index'] = '/showcase';

        //Hire Developer Url
        $ROUTER['hiredeveloper']['index'] = '/hiredeveloper/';
        $ROUTER['hiredeveloper']['phpdeveloper'] = '/hiredeveloper/phpdeveloper';
        $ROUTER['hiredeveloper']['zenddeveloper'] = '/hiredeveloper/zenddeveloper';
        $ROUTER['hiredeveloper']['cakephpdeveloper'] = '/hiredeveloper/cakephpdeveloper';
        $ROUTER['hiredeveloper']['codeigniterdeveloper'] = '/hiredeveloper/codeigniterdeveloper';
        $ROUTER['hiredeveloper']['wordpressdeveloper'] = '/hiredeveloper/wordpressdeveloper';
        $ROUTER['hiredeveloper']['joomladeveloper'] = '/hiredeveloper/joomladeveloper';
        $ROUTER['hiredeveloper']['drupaldeveloper'] = '/hiredeveloper/drupaldeveloper';
        $ROUTER['hiredeveloper']['magentadeveloper'] = '/hiredeveloper/magentadeveloper';
        $ROUTER['hiredeveloper']['oscommercedeveloper'] = '/hiredeveloper/oscommercedeveloper';
        $ROUTER['hiredeveloper']['iphonedeveloper'] = '/hiredeveloper/iphonedeveloper';
        $ROUTER['hiredeveloper']['androiddeveloper'] = '/hiredeveloper/androiddeveloper';

        //Testimonials Url
        $ROUTER['testimonials']['index'] = '/testimonials';

        //About Us Url
        $ROUTER['aboutus']['index'] = '/aboutus';

        //Service Url
        $ROUTER['contactus']['index'] = '/contactus';
        
        //Social Media
        $ROUTER['facebook'] = 'http://www.facebook.com/citrus.bug';
        $ROUTER['twitter'] = 'https://twitter.com/citrusbug';
        $ROUTER['linkedin'] = '#';
        return $ROUTER;
    }

    protected function _initView() {

        // Initialize view
        $view = new Zend_View();
        $ROUTER = Zend_Registry::get('ROUTER');
        
        // Initialize CONFIG
        $config = Zend_Registry::get('config');
        $view->headScript()->appendFile($config->JS_PATH . 'html5.js');
        $view->headScript()->appendFile($config->JS_PATH . 'jquery-1.7.2.min.js');
        $view->headScript()->appendFile($config->JS_PATH . 'slides.jquery.js');
	$view->headScript()->appendFile($config->JS_PATH . 'jquery.fancybox.js');
        $view->headScript()->appendFile($config->JS_PATH . 'project.js');
        $view->headScript()->appendFile($config->JS_PATH . 'general.js');
	$view->headScript()->appendFile($config->JS_PATH . 'quote-callback-rightside.js');
	#$view->headScript()->appendFile($config->JS_PATH . 'custom.js');
	
		
	/*Layout scripts over here*/	
	$view->headScript()->appendFile($config->JS_PATH . 'jquery.mobile.customized.min.js');
	$view->headScript()->appendFile($config->JS_PATH . 'custom.modernizr.js');
	$view->headScript()->appendFile($config->JS_PATH . 'navigationmenu.js');
	/*Layout scripts over here*/	
	
	
	
	
	
	
	
	
	
	#$view->headScript()->appendFile($config->JS_PATH . 'custom.js');
	
	
        $view->headLink()->appendStylesheet($config->CSS_PATH . 'style.css');
        $view->headLink()->appendStylesheet($config->CSS_PATH . 'responsive.css');
		$view->headLink()->appendStylesheet($config->CSS_PATH . 'jquery.fancybox.css');
		
		/*Layout CSS over here*/	
		$view->headLink()->appendStylesheet($config->CSS_PATH . 'navigationmenu.css');
		/*Layout CSS over here*/	
	
        $view->doctype('XHTML1_STRICT');
        // Add it to the ViewRenderer
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
                        'ViewRenderer'
        );
        $viewRenderer->setView($view);
        // Return it, so that it can be stored by the bootstrap
        return $view;
    }
	
	
    public function getRouterArray() {
	//Root Url
	$ROUTER['base']['index'] = '/';

	//Service Url
	$ROUTER['services']['index'] = '/services';

	//Web Development
	$ROUTER['webdevelopment']['index'] = '/web-development';
	$ROUTER['webdevelopment']['phpdevelopment'] = '/php-web-development';
	$ROUTER['webdevelopment']['mobilewebdevelopment'] = '/mobile-web-development';

	//Web Design
	$ROUTER['webdesign']['index'] = '/web-designing';
	$ROUTER['webdesign']['htmldevelopment'] = '/html-development';
	$ROUTER['webdesign']['logodesign'] = '/logo-design';
	$ROUTER['webdesign']['psddevelopment'] = '/psd-development';
	$ROUTER['webdesign']['psdtohtmldevlopment'] = '/psd-to-html-designs';
	$ROUTER['webdesign']['jquerydevelopment'] = '/jquery-development';

	//Open Source
	$ROUTER['opensource']['index'] = '/opensource-technologies';
	$ROUTER['opensource']['zend'] = '/zend-development';
	$ROUTER['opensource']['cakephp'] = '/cakephp-development';
	$ROUTER['opensource']['codeigniter'] = '/codeigniter-development';
	$ROUTER['opensource']['wordpress'] = '/wordpress-development';
	$ROUTER['opensource']['joomla'] = '/joomla-development';
	$ROUTER['opensource']['drupal'] = '/drupal-development';
	$ROUTER['opensource']['oscommerce'] = '/oscommerce-development';
	$ROUTER['opensource']['magento'] = '/magento-development';

	//Internet Marketing
	$ROUTER['internetmarketing']['index'] = '/internet-marketing-services';
	$ROUTER['internetmarketing']['seoservices'] = '/seo-services';
	$ROUTER['internetmarketing']['searchenginemarketing'] = '/search-engine-marketing';
	$ROUTER['internetmarketing']['socialmedia'] = '/social-media-marketing';
	$ROUTER['internetmarketing']['mobilemarketing'] = '/mobile-marketing';

	//Mobile Application
	$ROUTER['mobileapplication']['index'] = '/mobile-application-development';
	$ROUTER['mobileapplication']['iphoneappdevelopment'] = '/iphone-ipad-development';
	$ROUTER['mobileapplication']['androidappdevelopment'] = '/android-application-development';

	//Showcase Url
	$ROUTER['showcase']['index'] = '/our-portfolio';

	//Hire Developer Url
	$ROUTER['hiredeveloper']['index'] = '/hire-professionals';
	$ROUTER['hiredeveloper']['phpdeveloper'] = '/hire-php-developer';
	$ROUTER['hiredeveloper']['zenddeveloper'] = '/hire-zend-developer';
	$ROUTER['hiredeveloper']['cakephpdeveloper'] = '/hire-cakephp-developer';
	$ROUTER['hiredeveloper']['codeigniterdeveloper'] = '/hire-codeigniter-developer';
	$ROUTER['hiredeveloper']['wordpressdeveloper'] = '/hire-wordpress-developer';
	$ROUTER['hiredeveloper']['joomladeveloper'] = '/hire-joomal-developer';
	$ROUTER['hiredeveloper']['drupaldeveloper'] = '/hire-drupal-developer';
	$ROUTER['hiredeveloper']['magentadeveloper'] = '/hire-magento-developers';
	$ROUTER['hiredeveloper']['oscommercedeveloper'] = '/hire-oscommerce-developers';
	$ROUTER['hiredeveloper']['iphonedeveloper'] = '/hire-iphone-ipad-developers';
	$ROUTER['hiredeveloper']['androiddeveloper'] = '/hire-android-developer';

	//Testimonials Url
	$ROUTER['testimonials']['index'] = '/testimonials';

	//About Us Url
	$ROUTER['aboutus']['index'] = '/about-us';

	//Contact Us Url
	$ROUTER['contactus']['index'] = '/contact-us';

	//Quote Us Url
	$ROUTER['quoteus']['index'] = '/quote-us';

	//Social Media
	$ROUTER['facebook'] = 'http://www.facebook.com/citrus.bug';
	$ROUTER['twitter'] = 'https://twitter.com/citrusbug';
	$ROUTER['linkedin'] = '#';
	return $ROUTER;
    }



    protected function _initAutoload() {
        // Add autoloader empty namespace
        $autoLoader = Zend_Loader_Autoloader::getInstance();
		$autoLoader->registerNamespace(array('CMS_'));
        $resourceLoader = new Zend_Loader_Autoloader_Resource(array(
                    'basePath' => APPLICATION_PATH,
                    'namespace' => '',
                    'resourceTypes' => array(
                        'form' => array(
                            'path' => 'forms/',
                            'namespace' => 'Form_',
                        ),
                        'model' => array(
                            'path' => 'models/',
                            'namespace' => 'Model_'
                        )
                    ),
                ));
        // Return it so that it can be stored by the bootstrap
        return $autoLoader;
    }

}
